function Read-Parameters {
    [CmdletBinding()]
    [OutputType('Parameters')]
    param (
        [Parameter(Mandatory = $true, HelpMessage = "Parameter file path.")][ValidateScript({ Test-Path $_ -PathType "Leaf" })][string]$FilePath
    )

    $fileContents = Get-Content -Path $FilePath

    if ($null -eq $fileContents) {
        Write-Verbose 'Parameter file is empty.'
        return New-Object -TypeName 'Parameters'
    }
    
    Write-Verbose "Reading and deserializing parameters from parameter file."
    $params = [System.Web.Script.Serialization.JavaScriptSerializer]::new().Deserialize($fileContents, 'Parameters')

    return $params

    <#
    .SYNOPSIS
        Reads parameters from file.
    .DESCRIPTION
        The Read-Parameters function reads deployment parameters, necessary for the LS Insight deployment, from a file and returns an object of type 'Parameters'.

        This function opens up the possibility of storing and reusing deployment parameters between different deployment processes.
    .EXAMPLE
        PS C:\> $Params = Read-Parameters -FilePath "file"
        PS C:\> $Params

        LSCentral           LSInsight           Azure           ConfirmAll
        ---------           ---------           -----           ----------
        LSCentralParameters LSInsightParameters AzureParameters      False
    .INPUTS
        None. You cannot pipe objects to Read-Parameters.
    .OUTPUTS
        Parameters. Read-Parameters returns an LS Insight deployment parameter object.
    .PARAMETER FilePath
        Specifies the path to the parameters json file.
        Required?                    true
        Position?                    
        Default value
        Accept pipeline input?       false
        Accept wildcard characters?  false
    #>
}